<template>
	<view class="fixed-header">
		<view style="height: 20px" />
		<view class="header" style="height: 35px">
			<view><u-icon name="arrow-left-double" @click="headleTo" color="#ffffff" size="28"></u-icon></view>
			<view class="title">{{title}}</view>
			<img width='25'
				src="https://img2.baidu.com/it/u=4136987256,283353262&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=520"
				alt="">
		</view>
	</view>
</template>

<script>
	export default {
		name: "nav_bar",
		props: ['title'],
		methods: {
			headleTo() {
				uni.navigateBack()
			}
		}
	}
</script>

<style scoped lang="scss">
	.fixed-header {
		background: #0e932e;
		position: fixed;
		/* 固定头部 */
		width: 100%;
		/* 宽度占满整个视口 */
		z-index: 999;
		/* 确保头部在最顶层 */
		.header {
			padding: 0 20px;
			display: flex;
			justify-content: space-between;
			align-items: center;
			
			.title {
				color: white;
				font-size: 20px;
				font-weight: 540;
			}
			
			img{
				border-radius: 50%;
			}
		}
	}
</style>